<?php

require 'db.php';
$id=  isset($_GET['id'])?$_GET['id']:0;
$sp="delete from tb_books where id='$id'";
$rs=$db->query($sp);
if($rs){
   echo '<script anguage="javascript">';
    echo 'alert("成功了！");';
    echo 'window.location.href="index.php"';
    echo '</script>';
}else{
    echo '<script anguage="javascript">';
    echo 'alert("失败了！");';
    echo 'window.location.href="index.php"';
    echo '</script>';
}
$db->close();